#include "gtkwidgetprivate.h"
#include "gtkwindow.h"
#include "gtkcssnodeprivate.h"
-#include "gtkcsscustomgadgetprivate.h"
#include "gtkwidgetprivate.h"
#include "a11y/gtklabelaccessibleprivate.h"
GtkLabelSelectionInfo *select_info;
GtkWidget *mnemonic_widget;
GtkWindow *mnemonic_window;
- GtkCssGadget *gadget;
PangoAttrList *attrs;
PangoAttrList *markup_attrs;
GtkLabel *label);
static GtkSizeRequestMode gtk_label_get_request_mode (GtkWidget *widget);
-static void gtk_label_measure_ (GtkWidget *widget,
+static void gtk_label_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *minimum_baseline,
int *natural_baseline);
-static void gtk_label_measure (GtkCssGadget *gadget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline,
- gpointer unused);
-
static GtkBuildableIface *buildable_parent_iface = NULL;
G_DEFINE_TYPE_WITH_CODE (GtkLabel, gtk_label, GTK_TYPE_WIDGET,
widget_class->popup_menu = gtk_label_popup_menu;
widget_class->focus = gtk_label_focus;
widget_class->get_request_mode = gtk_label_get_request_mode;
- widget_class->measure = gtk_label_measure_;
+ widget_class->measure = gtk_label_measure;
class->move_cursor = gtk_label_move_cursor;
class->copy_clipboard = gtk_label_copy_clipboard;
priv->mnemonic_window = NULL;
priv->mnemonics_visible = TRUE;
-
- priv->gadget = gtk_css_custom_gadget_new_for_node (gtk_widget_get_css_node (GTK_WIDGET (label)),
- GTK_WIDGET (label),
- gtk_label_measure,
- NULL,
- NULL,
- NULL,
- NULL);
}
gtk_label_clear_links (label);
g_free (priv->select_info);
- g_clear_object (&priv->gadget);
-
G_OBJECT_CLASS (gtk_label_parent_class)->finalize (object);
}
{
GtkAllocation allocation;
- gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
+ gtk_widget_get_content_allocation (GTK_WIDGET (label), &allocation);
pango_layout_set_width (priv->layout, allocation.width * PANGO_SCALE);
}
}
static void
-gtk_label_measure (GtkCssGadget *gadget,
+gtk_label_measure (GtkWidget *widget,
GtkOrientation orientation,
int for_size,
int *minimum,
int *natural,
int *minimum_baseline,
- int *natural_baseline,
- gpointer unused)
+ int *natural_baseline)
{
- GtkWidget *widget;
- GtkLabel *label;
- GtkLabelPrivate *priv;
-
- widget = gtk_css_gadget_get_owner (gadget);
- label = GTK_LABEL (widget);
- priv = label->priv;
+ GtkLabel *label = GTK_LABEL (widget);
+ GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
if (orientation == GTK_ORIENTATION_VERTICAL && for_size != -1 && priv->wrap)
{
gtk_label_get_preferred_size (widget, orientation, minimum, natural, minimum_baseline, natural_baseline);
}
-static void
-gtk_label_measure_ (GtkWidget *widget,
- GtkOrientation orientation,
- int for_size,
- int *minimum,
- int *natural,
- int *minimum_baseline,
- int *natural_baseline)
-{
- gtk_css_gadget_get_preferred_size (GTK_LABEL (widget)->priv->gadget,
- orientation,
- for_size,
- minimum, natural,
- minimum_baseline, natural_baseline);
-}
-
static void
get_layout_location (GtkLabel *label,
gint *xp,
req_width = logical.width;
req_height = logical.height;
- gtk_css_gadget_get_content_allocation (priv->gadget,
- &allocation,
- &baseline);
+ gtk_widget_get_content_allocation (widget, &allocation);
+
+ baseline = gtk_widget_get_allocated_baseline (widget);
x = floor (allocation.x + xalign * (allocation.width - req_width) - logical.x);
GTK_WIDGET_CLASS (gtk_label_parent_class)->size_allocate (widget, allocation);
- gtk_css_gadget_allocate (priv->gadget,
- allocation,
- gtk_widget_get_allocated_baseline (widget),
- &clip);
-
if (priv->layout)
gtk_label_update_layout_width (label);